import { createRouter, createWebHistory } from 'vue-router'
import IndexView from '../views/index.vue'
import menu from '../views/menu.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'menu',
      component: menu,
      redirect: '/index',
      children: [
        {
          path: 'index',
          name: 'index',
          component: IndexView,
        },
        {
          path: '/device',
          name: 'device',
          component: () => import('../views/device.vue'),
        },
        {
          path: '/flv',
          name: 'flv',
          component: () => import('../components/device/flv.vue'),
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login.vue'),
    }
  ],
})

export default router
